﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace CarbonMeter
{
    static class Program
    {
        public static LicensingManagerForm frmLicensing;
        public static LoginForm frmLogIn;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            
            #if DEBUG
            frmLogIn = new LoginForm();
            Application.Run(frmLogIn);
            #else

            //LoadingForm frmLoad = new LoadingForm();
            //frmLoad.Show();

            frmLogIn = new LoginForm();

            //lisansla event objesi olusturuldu
            LicenseStateEvent lcStateEventObj = new LicenseStateEvent();
            frmLicensing = new LicensingManagerForm(lcStateEventObj);
            LicenseStateListenerClass lcStateListener = new LicenseStateListenerClass(frmLicensing, frmLogIn);
            lcStateEventObj.LicenseEvent += new LicenseStateEvent.LicenseHandler(lcStateListener.LicenseStateListener);
            frmLicensing.LicenseCheck();
#endif
        }
    }
}
